package com.project.platform.service.impl;

import com.project.platform.entity.HealthRecord;
import com.project.platform.mapper.HealthRecordMapper;
import com.project.platform.service.HealthRecordService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import com.project.platform.vo.PageVO;

import java.util.List;
import java.util.Map;

/**
 * ${table.name}
 */
@Service
public class HealthRecordServiceImpl  implements HealthRecordService {
    @Resource
    private HealthRecordMapper healthRecordMapper;
    
    @Override
    public PageVO<HealthRecord> page(Map<String, Object> query, Integer pageNum, Integer pageSize) {
        PageVO<HealthRecord> page = new PageVO();
        List<HealthRecord> list = healthRecordMapper.queryPage((pageNum - 1) * pageSize, pageSize, query);
        page.setList(list);
        page.setTotal(healthRecordMapper.queryCount(query));
        return page;
    }

    @Override
    public HealthRecord selectById(Integer id) {
        HealthRecord healthRecord = healthRecordMapper.selectById(id);
        return healthRecord;
    }

    @Override
    public List<HealthRecord> list() {
        return healthRecordMapper.list();
    }
    @Override
    public void insert(HealthRecord entity) {
        check(entity);
        healthRecordMapper.insert(entity);
    }
    @Override
    public void updateById(HealthRecord entity) {
        check(entity);
        healthRecordMapper.updateById(entity);
    }
    private void check(HealthRecord entity) {

    }
    @Override
    public void removeByIds(List<Integer> ids) {
        healthRecordMapper.removeByIds(ids);
    }




}
